﻿Imports Negocio
Imports Excepciones

Public Class MenuStripExt
    Inherits MenuStrip
    Implements IControlTranslatable

    Sub New()
        'Me.Renderer = New ToolStripProfessionalRenderer(New MenuStripColores)
    End Sub
    Public Sub Translate(ctrls As List(Of Control)) Implements IControlTranslatable.Translate
        Try
            For Each c As Control In ctrls
                Dim it As ToolStripItem() = Me.Items.Find(c.Nombre, True)
                If it.Length > 0 Then
                    it(0).Text = c.Caption
                End If
            Next
        Catch ex As Exception
            Throw New ControlNotSupportedLocalizationException()
        End Try
        Throw New ControlFoundLocalizationException()
    End Sub

End Class

Public Class MenuStripColores
    'http://franciscomolina.wordpress.com/2007/10/16/y-otros-controles-de-windows-blablabla-net/
    Inherits ProfessionalColorTable

    Public Overrides ReadOnly Property ButtonCheckedGradientBegin() As System.Drawing.Color

        Get
            Return Color.Red
        End Get

    End Property

    Public Overrides ReadOnly Property ButtonCheckedGradientEnd As System.Drawing.Color
        Get
            Return Color.Green
        End Get
    End Property

    Public Overrides ReadOnly Property ToolStripDropDownBackground As System.Drawing.Color
        Get
            Return Color.Blue
        End Get
    End Property
End Class